<?xml version="1.0" ?>
<project name="WordReader" default="jarfile">

    <!-- Initialize build properties  -->
    <target name="init" description="Initializes properties">
        <property name="project.name" value="WordReader" />
        <property name="src.dir" value="src" />
        <property name="main.class" value="org.academiadecodigo.enuminatti.wordreader.Main" />
        <property name="build.dir" value="build" />
        <property name="classes.dir" value="${build.dir}/classes" />
        <property name="lib.dir" value="lib" />
    </target>

    <!-- Creates the build directories to hold JAR and Janela files -->
    <target name="prepare" description="Creates the build and classes directories" depends="init">
        <mkdir dir="${classes.dir}" />
    </target>

    <!-- Removes the build directory -->
    <target name="clean" description="Clean up project" depends="init">
        <delete dir="${build.dir}" />
    </target>

    <!-- Compiles the source code -->
    <target name="compile" description="Compiles the source code" depends="prepare">
        <javac includeantruntime="false" srcdir="${src.dir}" destdir="${classes.dir}"/>
    </target>

    <!-- Creates a JAR file -->
    <target name="jarfile" description="Archives the code" depends="compile">
        <jar destfile="${build.dir}/${project.name}.jar" basedir="${classes.dir}">
            <manifest>
                <attribute name="Main-Class" value="${main.class}" />
            </manifest>
        </jar>
    </target>

</project>
